package com.wwdx.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wwdx.utils.ConstantHolder;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

/**
 * @author liguoliang
 * @date 2018/9/28 16:59
 */
public abstract class BaseMerchantOrderDTO implements Serializable{

    /**
     * 商户订单统计
     */
    @Data
    public static class MerchantOrderStatisticsDTO implements Serializable {
        /**
         * 今日收入
         */
        private BigDecimal todayIncome;
        /**
         * 今日订单
         */
        private BigInteger todayOrder;
        /**
         * 总收入
         */
        private BigDecimal totalIncome;
        /**
         * 总订单数
         */
        private BigInteger totalOrder;
    }

    /**
     * 商户订单列表
     */
    @Data
    public static class MerchantOrderListDTO implements Serializable,Cloneable{
        /**
         * 用户
         */
        private String userName;
        /**
         * 产品名称
         */
        private String productName;
        /**
         * 产品价格
         */
        private BigDecimal productPrice;
        /**
         * 购买时间
         */
        @JsonFormat(pattern = ConstantHolder.Constant.DATE_TIME_PATTERN)
        private Date payTime;

        @Override
        public Object clone() {
            try {
                return super.clone();
            }catch (CloneNotSupportedException e){
                e.printStackTrace();
                return null;
            }
        }
    }
}